/* (C) C.D.F. Miller, Heriot-Watt University, March 1984
 *
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */

#include        <string.h>
#include	<lbl.h>
#include        "build.h"
#include        "find.h"

extern std::list<Type *> typehead;

Type *
findtype(char *name, int create)
{
	for (Type *tp : typehead) {
		if (strcmp(name, tp->t_name) == 0)
			return tp;
	}
	if (create)
		return addtype(name);
	return NULL;
}

Label *
Type::findlabel(char *name)
{
	for (Label *lp : labelhead) {
		if (strcmp(name, lp->l_name) == 0)
			return lp;
	}
	return NULL;
}
